import http from "./http.js";

let item = {
	mds: [],
	lxmap: undefined,
	roomfunc: undefined,
	roomtp: undefined,
	kczt: {
		"C":"已取消",
		"D":"进行中",
		"F":"已完成",
		"B":"报名中",
	},
	get: function(type) {
		return http.get({
			url: "/dict/info",
			data: {
				type
			}
		});
	},
	loadMds: function() {
		return new Promise((resolve,reject) => {
			http.post({
				url: "/md/list/get",
				data: {
					flg: true
				}
			}).then(data => {
				resolve(data);
			});
		});
	},
	loadLx: function() {
		return new Promise((resolve,reject) => {
			http.get({
				url: "/kc/lx/map"
			}).then(data => {
				resolve(data);
			});
		});
	}
};


item.loadMds().then(data => {
	item.mds = data.mds;
});

// item.loadLx().then(data => {
// 	item.lxmap = data;
// });

item.get("ROOMFUNC").then(data => {
	item.roomfunc = data;
});

item.get("ROOMTP").then(data => {
	item.roomtp = data;
});

// item.get("KCZT").then(data => {
// 	item.kczt = data;
// });

export default item;